package ipc;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class Logger extends Thread{
	private static final boolean DEBUG = true;
	private BufferedWriter pw;
	
	public Logger(String fname){
		if(!DEBUG)
			return;

		try {
			pw = new BufferedWriter(new FileWriter(fname));
		} catch (IOException e) {
			e.printStackTrace();
		} 
	}
	
	public void log(String stuff){
		try {
			pw.write(stuff+"\n");
			pw.flush();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	@Override
	public void run() {
		super.run();
	}
}
